// pages/homeIndex/index.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    statusBarHeight: app.globalData.height + 'px',
    navigationBarHeight: (app.globalData.height + 44) + 'px',
    bgColor:'#FFD101',
    addressMsg:{},//定位地址信息
    typeList:[
      {name:'零食外卖',img:'../../static/images/homeIndex/lswm.png',url:'/pages/user/index/index',type:1},
      {name:'优选好店',img:'../../static/images/homeIndex/yxhd.png',url:'',type:2},
      {name:'超级会员',img:'../../static/images/homeIndex/cjhy.png',url:'',type:3},
      {name:'优选电商',img:'../../static/images/homeIndex/yxds.png',url:'/pages/youXuan/tabBar/index/index',type:4},
      {name:'加盟入口',img:'../../static/images/homeIndex/jmrk.png',url:'',type:5},
      {name:'景点门票',img:'../../static/images/homeIndex/jdmp.png',url:'',type:6},
      {name:'电影票务',img:'../../static/images/homeIndex/dypw.png',url:'',type:7},
      {name:'爆款生活',img:'../../static/images/homeIndex/bksh.png',url:'',type:8},
      {name:'同城生活',img:'../../static/images/homeIndex/tcsh.png',url:'',type:9},
      {name:'每日签到',img:'../../static/images/homeIndex/mrqd.png',url:'',type:10},
    ],
    tabIndex:1
  },
  goRuKou(event){
    var item = event.currentTarget.dataset.item
    if(item.url){
      wx.navigateTo({
        url: item.url,
      })
    }
  },
  changeTab(event){
    //切换tab
    var dataset=event.currentTarget.dataset
    this.setData({
      tabIndex:dataset.id
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})